#ifndef __TIMER_H
#define __TIMER_H

#include <sys/time.h>
#include <time.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef struct tmr_s
{
  struct timeval started;
  struct timeval stopped;
} tmr_t;

tmr_t tmrInit(void);
void tmrStart(tmr_t *timer);
void tmrStop(tmr_t *timer);
unsigned long long tmrGetValueInUs(const tmr_t *timer);
void tmrSetValueInUs(tmr_t *timer, unsigned long long int value);

#ifdef __cplusplus
}
#endif

#endif /* __TIMER_H */
